﻿using System;
using System.Collections.Generic;
using Acaweb.Data.Contracts;
using Acaweb.Model.Entities;
using Acaweb.Model.Entities.DatosCompuestos;
using Spring.Transaction.Interceptor;
using System.Linq;

namespace Acaweb.Data.Dao.NHibernate
{
    public class HistorialAcademicoDao : HibernateDao<HistorialAcademico, HistorialAcademicoPk>, IHistorialAcademicoDao
    {
        public IList<HistorialAcademico> GetAll()
        {
            return GetAll<HistorialAcademico>();
        }

        public void Delete(HistorialAcademicoPk obj)
        {
            HistorialAcademico H = this.GetById(obj);
            this.Delete(H);
        }

        public IList<HistorialAcademico> GetByAsociado(int CodigoInterno)
        {
            return this.Session.QueryOver<HistorialAcademico>().Where(t => t.HistorialAcademicoPk.CodigoInterno == CodigoInterno).List();
        }
    }
}